package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.JiajiaPointsFlowDetail;
import com.ruoyi.system.mapper.JiajiaPointsFlowDetailMapper;
import com.ruoyi.system.service.IJiajiaPointsFlowDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 项目积分流水明细，用于比例解锁Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-17
 */
@Service
public class JiajiaPointsFlowDetailServiceImpl implements IJiajiaPointsFlowDetailService 
{
    @Autowired
    private JiajiaPointsFlowDetailMapper jiajiaPointsFlowDetailMapper;

    /**
     * 查询项目积分流水明细，用于比例解锁
     * 
     * @param id 项目积分流水明细，用于比例解锁主键
     * @return 项目积分流水明细，用于比例解锁
     */
    @Override
    public JiajiaPointsFlowDetail selectJiajiaPointsFlowDetailById(Long id)
    {
        return jiajiaPointsFlowDetailMapper.selectJiajiaPointsFlowDetailById(id);
    }

    /**
     * 查询项目积分流水明细，用于比例解锁列表
     * 
     * @param jiajiaPointsFlowDetail 项目积分流水明细，用于比例解锁
     * @return 项目积分流水明细，用于比例解锁
     */
    @Override
    public List<JiajiaPointsFlowDetail> selectJiajiaPointsFlowDetailList(JiajiaPointsFlowDetail jiajiaPointsFlowDetail)
    {
        return jiajiaPointsFlowDetailMapper.selectJiajiaPointsFlowDetailList(jiajiaPointsFlowDetail);
    }

    /**
     * 新增项目积分流水明细，用于比例解锁
     * 
     * @param jiajiaPointsFlowDetail 项目积分流水明细，用于比例解锁
     * @return 结果
     */
    @Override
    public int insertJiajiaPointsFlowDetail(JiajiaPointsFlowDetail jiajiaPointsFlowDetail)
    {
        jiajiaPointsFlowDetail.setCreateTime(DateUtils.getNowDate());
        return jiajiaPointsFlowDetailMapper.insertJiajiaPointsFlowDetail(jiajiaPointsFlowDetail);
    }

    /**
     * 修改项目积分流水明细，用于比例解锁
     * 
     * @param jiajiaPointsFlowDetail 项目积分流水明细，用于比例解锁
     * @return 结果
     */
    @Override
    public int updateJiajiaPointsFlowDetail(JiajiaPointsFlowDetail jiajiaPointsFlowDetail)
    {
        jiajiaPointsFlowDetail.setUpdateTime(DateUtils.getNowDate());
        return jiajiaPointsFlowDetailMapper.updateJiajiaPointsFlowDetail(jiajiaPointsFlowDetail);
    }

    /**
     * 批量删除项目积分流水明细，用于比例解锁
     * 
     * @param ids 需要删除的项目积分流水明细，用于比例解锁主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaPointsFlowDetailByIds(String ids)
    {
        return jiajiaPointsFlowDetailMapper.deleteJiajiaPointsFlowDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除项目积分流水明细，用于比例解锁信息
     * 
     * @param id 项目积分流水明细，用于比例解锁主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaPointsFlowDetailById(Long id)
    {
        return jiajiaPointsFlowDetailMapper.deleteJiajiaPointsFlowDetailById(id);
    }
}
